<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSettingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('settings', function (Blueprint $table) {
            $table->id();
            $table->char('website_name',20)->default('有趣红包')->comment('站点名称');
            $table->char('app_keyword',10)->nullable()->default('有趣红包')->comment('公众号应用出发关键词');
            $table->string('map_key',50)->nullable()->comment('高德地图Key');
            $table->double('share_ratio',5,2)->unsigned()->default(1.00)->comment('助力分享红包分成');
            $table->decimal('low_red_money',10,2)->unsigned()->default(0.00)->comment('发红包最低总额限制');
            $table->tinyInteger('open_send')->unsigned()->default(0)->comment('是否对外开放发红包功能');
            $table->tinyInteger('open_attention')->unsigned()->default(0)->comment('是否开启关注公众号功能');
            $table->tinyInteger('hint_attention')->unsigned()->default(0)->comment('发红包是否提示关注公众号');
            $table->text('sensitive_word')->nullable()->comment('系统敏感词');
            $table->string('notice',255)->nullable()->comment('系统公告');
            $table->integer('notice_time')->unsigned()->default(0)->comment('系统公告修改时间');
            $table->tinyInteger('coupon_check')->default(1)->unsigned()->comment('卡券修改新增是否需要审核');
            $table->string('aq',100)->nullable()->comment('域名备案号');
            $table->string('ga',100)->unique()->comment('公安备案号');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('settings');
    }
}
